import matplotlib.pyplot as plt
import numpy as np

plt.rcParams['font.sans-serif']=['SimHei']
#准备男生、女生的人数
man=71351
woman=68187

man_pre=man/(man+woman)
woman_pre=woman/(man+woman)

#绘制
# 添加名称
labels=['男','女']
#添加颜色
colors=['blue','red']
#分裂--explode
paches,texts,autotexts=plt.pie([man_pre,woman_pre],labels=labels,colors=colors,explode=(0,0.05),autopct='%0.1f%%')

#设置饼状图中的字体颜色
for text in autotexts:
    text.set_color('white')

#设置字体大小
for text in texts+autotexts:
    text.set_fontsize(20)
plt.show()